from ultralytics import YOLO


#load a model
model = YOLO("last.pt")

#train a model
train_result = model.train(
    data = "F:/data/dataset/pdf-txt/dyson.yaml", #path to dataset YAML
    epochs = 15, # 训练15轮
    imgsz = 1280,
    #device = "cpu", #device to run on, i.e. device = 0 or device = 0,1,2,3 or device cpu
)